package com.qymerge.manage.core.enums;

import org.apache.commons.lang.StringUtils;

/**
 * Desc
 * User cong.li
 * Date 2017/4/4
 * Time 22:33
 */
public enum EnvTypes {

    DEV("dev", "image_dev"),
    PROD("prod", "image");

    EnvTypes(String env, String imgRoot) {
        this.env = env;
        this.imgRoot = imgRoot;
    }

    private String env;
    private String imgRoot;

    public String getEnv() {
        return env;
    }

    public void setEnv(String env) {
        this.env = env;
    }

    public String getImgRoot() {
        return imgRoot;
    }

    public void setImgRoot(String imgRoot) {
        this.imgRoot = imgRoot;
    }

    public static EnvTypes get(String env) {
        if (StringUtils.isEmpty(env)) {
            return DEV;
        }
        for (EnvTypes types : EnvTypes.values()) {
            if (types.getEnv().equals(env)) {
                return types;
            }
        }
        return DEV;
    }

}
